package cn.dyaln.controller;


import cn.dyaln.fallbackFeignClient.UserFeignClient;
import cn.dylan.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pay")
public class PayController {

    //注入userFeignClient 实现类自动实现并且被spring框架管理
    @Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/{id}")
    public User handlerPay(@PathVariable("id") Long id){
        User user = userFeignClient.handlerGet(id);
        return user;
    }
}
